package com.woniuxy.controller;


import com.woniuxy.model.ProjectRoleUser;
import com.woniuxy.service.ProjectRoleUserService;
import com.woniuxy.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 马世亮
 * @since 2022-02-21
 */
@Api("项目角色用户关联接口")
@RestController
@RequestMapping("/projectRoleUser")
public class ProjectRoleUserController {
    @Resource
    private ProjectRoleUserService projectRoleUserService;

    @ApiOperation("通过uid获取项目角色，并返回可操作状态")
    @PostMapping("/getCanDoStates/{uid}")
    public Result getCanDoStates(@PathVariable Integer uid){
        List<String> canDoStates= projectRoleUserService.getCandoStates(uid);
        return Result.success(200,"查询成功",canDoStates);
    }

}

